// /////////////////////////////////////////////////////////////////////////////
//
// Name:            asSkyBoxComponent.cpp
// Author:          Michael Bartsch (ZCCdark203)
//
// Desc :           Binds the SkyBoxComponent class to AngelScript
//
// License:         Copyright (C) 2009 Michael Bartsch and Contributors
//
//                  This program is free software: you can redistribute it
//                  and/or modify it under the terms of the zlib/libpng License.
//                  See main.cpp for conditions of distribution and use.
//
// /////////////////////////////////////////////////////////////////////////////

// Include files
#include "asSkyBoxComponent.h"

#ifdef __COMPILE_WITH_ANGELSCRIPT__

#include "../../ScriptHelper.h"
#include "asSceneComponent.h"

#include "../../../components/scene/SkyBoxComponent.h"


//! Reference factory for the SkyBoxComponent class.
SkyBoxComponent* createSkyBoxComponent(Entity *parent)
{
    return new SkyBoxComponent(parent);
}

//! Reference factory for the SkyBoxComponent class.
SkyBoxComponent* createSkyBoxComponent(Entity *parent, const std::string &top,
                                       const std::string &bottom, const std::string &left,
                                       const std::string &right, const std::string &front,
                                       const std::string &back)
{
    return new SkyBoxComponent(parent, top, bottom, left, right, front, back);
}

//! Binds the SkyBoxComponent class to AngelScript.
void bindSkyBoxComponent(asIScriptEngine *engine)
{
    // Forward declarations.
    int r;

    // Bind SkyBoxComponent class.
    r = engine->RegisterObjectType("SkyBoxComponent", sizeof(SkyBoxComponent), asOBJ_REF); assert(r >= 0);

    // Bind inherited functions.
    bindSceneComponentBase<SkyBoxComponent>(engine, "SkyBoxComponent");

    // Set SkyboxComponent behaviour.
    r = engine->RegisterObjectBehaviour("SkyBoxComponent", asBEHAVE_FACTORY, "SkyBoxComponent@ f(Entity @+)",
                                        asFUNCTIONPR(createSkyBoxComponent, (Entity*), SkyBoxComponent*), asCALL_CDECL);
                                        assert(r >= 0);
    r = engine->RegisterObjectBehaviour("SkyBoxComponent", asBEHAVE_FACTORY, "SkyBoxComponent@ f(Entity @+, " \
                                        "const string &in, const string &in, const string &in, const string &in, " \
                                        "const string &in, const string &in)",
                                        asFUNCTIONPR(createSkyBoxComponent, (Entity*, const std::string&,
                                        const std::string&, const std::string&, const std::string&, const std::string&,
                                        const std::string&), SkyBoxComponent*), asCALL_CDECL); assert(r >= 0);

    r = engine->RegisterObjectMethod("SkyBoxComponent", "SkyBoxComponent& opAssign(const SkyBoxComponent &in)",
                                     asFUNCTION(assignT<SkyBoxComponent>), asCALL_CDECL_OBJFIRST); assert(r >= 0);

    // Bind CameraComponent class functions.
    r = engine->RegisterObjectMethod("SkyBoxComponent", "void setTextures(const string &in, const string &in," \
                                     "const string &in, const string &in, const string &in, const string &in, bool)",
                                     asMETHODPR(SkyBoxComponent, setTextures, (const std::string&, const std::string&,
                                     const std::string&, const std::string&, const std::string&, const std::string&, bool),
                                     void), asCALL_THISCALL); assert(r >= 0);
}

#endif // __COMPILE_WITH_ANGELSCRIPT__

// End of File
